import request from '@/utils/request'

export default {
  // 列表
  query(data) {
    return request({
      url: `/v1/purchase-config/reason-config/list`,
      method: 'post',
      data
    })
  },
  // 添加
  add(data) {
    return request({
      url: `/v1/purchase-config/reason-config/create`,
      method: 'post',
      data
    })
  },
  // 修改
  update(data) {
    return request({
      url: `/v1/purchase-config/reason-config/edit`,
      method: 'post',
      data
    })
  },
  // 详情
  detail(params) {
    return request({
      url: `/v1/purchase-config/reason-config/detail`,
      method: 'get',
      params
    })
  },
  // 批量启用/禁用
  status(data) {
    return request({
      url: `/v1/purchase-config/reason-config/change-status`,
      method: 'post',
      data,
    })
  },
  // 获取优先级
  level(data) {
    return request({
      url: `/v1/purchase-config/reason-config/get-level`,
      method: 'post',
      data,
    })
  },
  // 获取排序信息
  levelInfo(data) {
    return request({
      url: `/v1/purchase-config/reason-config/get-level-info`,
      method: 'post',
      data,
    })
  },
  // 修改排序信息
  updateLevel(data) {
    return request({
      url: `/v1/purchase-config/reason-config/update-level-info`,
      method: 'post',
      data,
    })
  },
  // 类型映射
  relation(params) {
    return request({
      url: `/v1/purchase-config/reason-config/get-relation`,
      method: 'get',
      params,
    })
  }
}
